package com.example.musicserver.service;

import com.example.musicserver.mapper.LoveMusicMapper;
import com.example.musicserver.model.MusicInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class LoveMusicService {
    @Autowired
    private LoveMusicMapper loveMusicMapper;

    public List<MusicInfo> getList(Integer userId) {
        return loveMusicMapper.getAllLoveMusic(userId);
    }

    public List<MusicInfo> getList(Integer userId,String title) {
        return loveMusicMapper.getMusicByTitle(userId,title);
    }

    public Integer getByUidAndMid(Integer userId,Integer musicId) {
        return loveMusicMapper.getByUidAndMid(userId,musicId);
    }

    public Integer addLoveMusic(Integer userId,Integer musicId) {
        return loveMusicMapper.addLoveMusic(userId,musicId);
    }

    public Integer deleteLoveMusic(Integer userId,Integer musicId) {
        return loveMusicMapper.deleteLoveMusic(userId,musicId);
    }
}
